/*
角色管理相关的API请求函数
*/
import request from '@/utils/request'

const api_name='/admin/system/sysUser'

export default{
    getPageList(page,limit,searchobj){
        return request({
            url:`${api_name}/${page}/${limit}`,
            method:'get',
            params:searchobj
        } 
        )
    },
    removeById(id){
        return request({
            url:`${api_name}/remove/${id}`,
            method:'delete',
        
        })
    },
    save(sysUser){
        return request({
            url:`${api_name}/save`,
            method:'post',
            data:sysUser
        } 
        )
    },
    updateById(sysUser){
        return request({
            url:`${api_name}/update`,
            method:'put',
            data:sysUser
        } 
        )
    },
    getById(id){
        return request({
            url:`${api_name}/get/${id}`,
            method:'get',
        })
    },
    updateStatu(row){
      return request({
          url:`${api_name}/updateStatu`,
          method:'put',
          data:row
        }
      )
    },
    toAssign(id){
        return request({
            url:`${api_name}/toAssign/${id}`,
            method:'get',
       
          }
        )
    },
    doAssign(id,userRoleIds){
        return request({
            url:`${api_name}/doAssign`,
            method:'post',
            data:{
                userId:id,
                roleIdList:userRoleIds
            }
          }
        )
    }
    // batchRemove(idList){
    //     return request({
    //         url:`${api_name}/batchRemove`,
    //         method:'delete',
    //         data:idList
    //     })
    // }
}
